package ai.loa.framework.controller;

import ai.loa.ai.Mossa;
import ai.loa.ai.Stato;

//Classe di base per il controller di gioco
public abstract class LOAController {

	protected LOAGameObserver[] observers = new LOAGameObserver[2];
	public Stato stato;

	// TODO la classe MOVE
	public int getCurrentPlayer() {
		return stato.player;
	}

	public void setObserver(LOAGameObserver o, int player) {
		observers[player] = o;
	}

	protected void notifyPlayer(int player) {
		observers[player].turnChanged(stato);
	}

	public void startGame() {
		notifyPlayer(stato.player);
	}

	public abstract int winner();

	public abstract boolean doMove(Mossa move);

}
